/* 
* @Author: Jerry-chen
* @Date:   2014-07-01 16:54:16
* @Last Modified by:   Jerry-chen
* @Last Modified time: 2014-07-02 14:31:29
*/
// banner幻灯片JS代码
$(document).ready(function(){
	/*banner打折区域*/


    var dazhe_num=0;

      //自动翻放
      var timeer=setInterval(run, 2000);
       function run(){
        dazhe_num++;
        dazhe_num =(dazhe_num==4)?0:dazhe_num;
        document.title=dazhe_num;
        
        $('#banner .dazhes').eq(dazhe_num).fadeIn(300).siblings('#banner .dazhes').fadeOut(300);
         $('#banner .botT p').eq(dazhe_num).css('background','#2BB8AA').siblings().css('background','#CCCCCC');

      } ;
  	
  	$('#banner').mouseover(function() {
            // alert('fafda')
            //MOUSE放入#banner显示左右键按钮
            clearInterval(timeer);
          
            $('#banner .botL'). stop(). animate({'opacity':'1'});
            $('#banner .botR'). stop().animate({'opacity':'1'});
          });
    //MOUSE移出隐藏
      $('#banner').mouseout(function() {
              //MOUSE放入#banner隐藏左右键按钮
            
              $('#banner .botL'). stop(). animate({'opacity':'0'});
              $('#banner .botR'). stop().animate({'opacity':'0'});
            });
      var timeer=setInterval(run, 2000)
       //当MOUSE点击左边按钮时，当前的显示，其它的隐藏
      
       


     $('#banner .botL').click(function(){
      //控制左边
       dazhe_num--;
      dazhe_num=(dazhe_num==-4)?0:dazhe_num;
       document.title=dazhe_num;
        $('#banner .dazhes').eq(dazhe_num).fadeIn(300).siblings('#banner .dazhes').fadeOut(300);
        //控制小点
        $('#banner .botT p').eq(dazhe_num).css('background','#2BB8AA').siblings().css('background','#CCCCCC');

       

     })


     //控制右边
      $('#banner .botR').click(function(){
       dazhe_num++;
      dazhe_num=(dazhe_num==4)?0:dazhe_num;
      document.title=dazhe_num;
        $('#banner .dazhes').eq(dazhe_num).fadeIn(300).siblings('#banner .dazhes').fadeOut(300);

      $('#banner .botT p').eq(dazhe_num).css('background','#2BB8AA').siblings().css('background','#CCCCCC');

      
     })
    ///////////////////////////////////////////////////////////////////////////////////////////////////
    //2f楼层幻灯片
  // 自动播放
  var banpi=0;
  function run(){
    banpi++
    banpi=(banpi==5)?0:banpi;
    $('#rock .rock-banner img').eq(banpi).show().siblings().hide();
    //按钮
    $('#rock .rock-banner ul li').eq(banpi).css('background','#00AE28').siblings().css('background','#4C4C4C');
    //标题
   $('#rock .rock-banner .title  p').eq(banpi).show().siblings().hide();


  }
  
  var tu_timmer=setInterval(run,1000)
  // mouse移入
  $('#rock .rock-banner ul li').mouseover(function() {
    clearInterval(tu_timmer);
      var banpi=$(this).index();
      document.title=banpi
      $('#rock .rock-banner img').eq(banpi).show().siblings().hide();
      $('#rock .rock-banner ul li').eq(banpi).css('background','#00AE28').siblings().css('background','#4C4C4C');

  });
  // MOUSE移出
  $('#rock .rock-banner ul li').mouseout(function(){
    tu_timmer=setInterval(run,1000)
  })

   ///////////////////////////////////////////////////////////////////////////////////////////////////
    //3f楼层幻灯片
    var banpi2=0;
  function run2(){
    banpi2++
    banpi2=(banpi2==5)?0:banpi2;
    $('#music .music-banner img').eq(banpi2).show().siblings().hide();
    //按钮
    $('#music .music-banner ul li').eq(banpi2).css('background','#00AE28').siblings().css('background','#4C4C4C');
    //标题
   $('#music .music-banner .title  p').eq(banpi2).show().siblings().hide();


  }
  
  var tu_timmer=setInterval(run2,1000)
  // mouse移入
  $('#music .music-banner ul li').mouseover(function() {
    clearInterval(tu_timmer);
      var banpi2=$(this).index();
      document.title=banpi2
      $('#music .music-banner img').eq(banpi2).show().siblings().hide();
      $('#music .music-banner ul li').eq(banpi2).css('background','#00AE28').siblings().css('background','#4C4C4C');

  });
  // MOUSE移出
  $('#music .music-banner ul li').mouseout(function(){

    tu_timmer=setInterval(run2,1000)
  })
});